package cn.lutu.domain.service;


import cn.lutu.protocol.dto.ArticleCollectDTO;
import cn.lutu.protocol.dto.ArticlePostDTO;
import cn.lutu.protocol.dto.ArticleUpDTO;
import cn.lutu.protocol.vo.*;
import cn.lutu.security.jwtFilter.CurrentPrincipal;
import cn.lutu.util.pojo.vo.PageData;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Transactional
public interface ArticleService {
    Integer UNCHECK_ARTICLE = 0;//待审核
    Integer CHECK_ARTICLE = 1;//审核通过
    Integer REJECT_ARTICLE = 2;//审核不通过,退回


    void add_new(ArticlePostDTO articlePostDTO,Long userId) throws Exception;

    PageData<ArticleListVO> selectAll(Integer pageNum, Integer pageSize);
    PageData<ArticleListVO> selectAll(Integer pageNum);

    List<ArticleListVO> selectHotArt();

    List<ArticleListVO> selectRecent();

    List<ArticleSearchStandardVO> selectSearch(String textSearch);

    List<HotListVO> selectHot();

    void collect (ArticleCollectDTO articleCollectDTO);

    ArticleDetailVO selectArticleDetail(Long id,Long userId);


    void up (ArticleUpDTO articleUpDTO);

    void deleteById(Long id);

    PageData<ArticleOthersListVO> selectByUserId(Integer pageNum, Integer pageSize,Long userId);
    PageData<ArticleOthersListVO> selectByUserId(Integer pageNum, Long userId);


    PageData<ArticleOthersListVO> selectArticleUp(Integer pageNum, Integer pageSize,Long userId);
    PageData<ArticleOthersListVO> selectArticleUp(Integer pageNum, Long userId);

    PageData<ArticleOthersListVO> selectArticleCollect(Integer pageNum, Integer pageSize,Long userId);
    PageData<ArticleOthersListVO> selectArticleCollect(Integer pageNum, Long userId);

    PageData<ArticleListVO> selectUnCheck(Integer pageNum, Integer pageSize);
    PageData<ArticleListVO> selectUnCheck(Integer pageNum);

    void updateCheck(Long articleId,String checkRemarks);

    List<ArticleListVO> rejectCheckList();

    List<ArticleListVO> rejectCheckListById(Long userId);

    /*重建缓存*/
    void rebuildRedis();
    /*重建elasticsearch*/
    void rebuildSearch();
}
